package com.kl.forum.enums;

public enum DictNoviceEnum {
	UNKNOW(0,"未知类型", 0),
	MOBILE(1,"完成手机号验证", 400),
	SIGN3DAYS(2,"连续三天签到", 100),
	CASH(3,"成功提现一次", 100),
	RUNGAME(4,"参与健康跑步游戏一次", 200),
	DAYILTASK(5,"完成全部日常一次", 200),
	FINISH(99,"全部完成",1000);
	
	private int id;
	private String name;
	private int coins;
	
	DictNoviceEnum(int id, String name, int coins) {
		this.id = id;
		this.name = name;
		this.coins = coins;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}
	
	public int getCoins() {
		return coins;
	}

	/**
	 * 根据id获取名称
	 * @param id
	 * @return id错误返回未知类型
	 */
	public static DictNoviceEnum getEnumById(int id) {
		for (DictNoviceEnum novice : DictNoviceEnum.values()) {
			if (novice.getId() == id) {
				return novice;
			}
		}
		return UNKNOW;
	}
}
